<?php
/**
 * The template for displaying all pages.
 *
 * This is the template that displays all pages by default.
 * Please note that this is the WordPress construct of pages
 * and that other 'pages' on your WordPress site will use a
 * different template.
 *
 * @package WordPress
 * @subpackage Twenty_Eleven
 * @since Twenty Eleven 1.0
 */
get_header();
global $wp_query;

?>
<?php
if ($wp_query->posts[0]->ID != 4) {
    get_template_part('page_inner', get_post_format());
} else {
    ?>
    <div class="slideWrap">
        <div class="introBox">
            <div class="introPara"> 
                <p> 
                    <?php
                    $post_about = $wpdb->get_results("SELECT * FROM wp_ngg_gallery WHERE gid = 1");

                    $post_image = $wpdb->get_results("SELECT * FROM wp_ngg_pictures WHERE galleryid = 1 ORDER BY `order` ASC");
                    ?>
                    <?php echo htmlspecialchars_decode($post_about[0]->galdesc,ENT_NOQUOTES) ?>
                </p>
            </div>
            <div class="slider-wrapper theme-default">
                <div id="slider" class="nivoSlider">
                    <?php foreach ($post_image as $k => $v) : ?>
                        <a href ="<?php echo $v->link ?>">
                            <img src='<?php echo home_url() ?>/wp-content/gallery/banner/<?php echo $v->filename ?>' title ="<?php echo $v->description ?>" />
                        </a>
                    <?php endforeach; ?>    
                    <?php //echo $post_about[0]->slideshow ?>
                </div>
            </div>
        </div>
    </div>

    <div class="slide-shadow"> </div>
    <div class="wrap">
        <?php while (have_posts()) : the_post(); ?>

            <?php get_template_part('content', 'page'); ?>

        <?php endwhile; // end of the loop. ?>
    <?php } ?>
    <?php get_footer(); ?>